<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>编辑商品</title>
    <style>
        body {
            background-color: #f8f1f4;
            color: #8a4a6c;
            font-family: "Segoe UI", sans-serif;
        }
        form {
            width: 600px;
            margin: 50px auto;
            background-color: #fff5f9;
            border: 2px solid #ff99d6;
            border-radius: 10px;
            padding: 25px;
            box-shadow: 0 0 20px #ffb3e0;
        }
        table {
            width: 100%;
        }
        td {
            padding: 10px;
        }
        input, textarea {
            width: 100%;
            padding: 8px;
            background: #fff9fc;
            color: #8a4a6c;
            border: 1px solid #ffb3e0;
            border-radius: 5px;
        }
        input[type="submit"], a {
            display: inline-block;
            margin-top: 20px;
            padding: 10px 25px;
            background: #ff99d6;
            color: #8a4a6c;
            border-radius: 5px;
            text-decoration: none;
            font-weight: bold;
        }
        a:hover {
            background: #ffb3e0;
        }
    </style>
</head>
<body>
<h2 style="text-align:center; color: #8a4a6c; text-shadow: 0 0 5px #ff99d6;">编辑商品</h2>
<form action="${pageContext.request.contextPath}/goods/update" method="post">
    <input type="hidden" name="gid" value="${goods.gid}">
    <table>
        <tr><td>名称:</td><td><input type="text" name="name" value="${goods.name}" required></td></tr>
        <tr><td>介绍:</td><td><textarea name="intro">${goods.intro}</textarea></td></tr>
        <tr><td>价格:</td><td><input type="number" step="0.01" name="price" value="${goods.price}" required></td></tr>
        <tr><td>库存:</td><td><input type="number" name="stock" value="${goods.stock}" required></td></tr>
        <tr><td>分类ID:</td><td><input type="number" name="categoryId" value="${goods.categoryId}" required></td></tr>
    </table>
    <input type="submit" value="更新">
    <input type="button" class="btn" value="取消" onclick="window.location.href='${pageContext.request.contextPath}/goods/list'">
</form>
</body>
</html>